<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('添加图片')" />
	<th:block th:include="include :: bootstrap-fileinput-css" />
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
     <input id="id" th:value="${assetId}" type="hidden">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                        <div class="form-group">
	                        <div class="file-loading">
					            <input id="fileinput-demo-1" type="file" multiple>
					        </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-fileinput-js" />
    <script type="text/javascript">
        var prefix = ctx + "asset/assetDetail";
        $(document).ready(function () {
            $("#fileinput-demo-1").fileinput({
                'theme': 'explorer-fas',
                'uploadUrl': prefix+'/updateImgUrl',
                allowedFileExtensions: ['jpeg','jpg', 'png', 'gif'],
                'uploadExtraData':{"id":$("#id").val()},
                overwriteInitial: false,
                initialPreviewAsData: true,
                showPreview:true,
                resizeImage: true,
                maxImageWidth:1500,
                maxImageHeight:1500,
                resizePreference: 'width',
                resizeQuality: 0.92
            });
        });
        function submitHandler() {
            $.modal.close(layer.index);
            parent.$.table.refresh();
        }
    </script>
</body>
</html>
